#!/bin/sh

######################################################################
# Copyright (C) 2016. Shanghai Feixun Communication Co.,Ltd.
#
# DISCREPTION   : clean history of APPset
# AUTHOR        : maoyuan.li <maoyuan.li@phicomm.com.cn>
# CREATED DATE  : 2016-01-05
# MODIFIED DATE :
######################################################################

local his_num
local cnt=1
local find=0
local tmp
his_num=`uci get system.history.num`
while [ "$cnt" -le "$his_num" ]
do
	tmp=`uci get system.history."h""$cnt"`
	if [ "$tmp" == "APPset" ]
	then
		find=1		
		break
	fi
	cnt=$(( cnt+1 ))
done

if [ "$find" -eq "1" ]
then
	uci set system.history."h""${cnt}""_num"=0
	uci commit system
fi

exit 0
